package com.ws.wsdemo2.model;
import com.ws.wsdemo2.util.QuotePeriodUtil.PeriodType;

/**
 * @Classname QuotePeriod
 * @Description TODO
 * @Date 2019/5/20 11:34
 * @Created by Administrator
 */
public class QuotePeriod {
    private long startTime;
    private long endTime;
    private PeriodType type;

    public QuotePeriod() {
        super();
    }

    /**
     *
     * @param startTime 周期开始时间戳
     * @param endTime  周期结束时间戳
     * @param type 周期类型
     */
    public QuotePeriod(long startTime, long endTime, PeriodType type) {
        super();
        this.startTime = startTime;
        this.endTime = endTime;
        this.type = type;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public PeriodType getType() {
        return type;
    }

    public void setType(PeriodType type) {
        this.type = type;
    }

    /**
     * 获取上一周期开始时间
     * @return
     */
    public long getLastStartTime() {
        return startTime - (endTime - startTime);
    }

}
